package com.bauer.base.designpattern.proxy;

/**
 * @Author ：rui.wei
 * @Date ：Created in 9:49 2019/11/5
 * @Description： 代理类
 */
public class Proxy implements Subject {

    private Subject subject;


    public Proxy(Subject subject) {
        this.subject = subject;
    }

    @Override
    public void doSomeThing() {
        before();
        subject.doSomeThing();
        after();
    }


    private void before() {
        System.out.println("before-----------");
    }

    private void after() {
        System.out.println("after-----------");
    }
}
